package demo1;

import java.util.Scanner;

/**
 * @Author liangzai
 * @Description:
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int count = 0;
        String ch = scanner.nextLine();
        char a = ch.charAt(0);
        char b = ch.charAt(1);
        String string = scanner.next();
//        while(true){
//            if(!scanner.hasNext()) {
//                break;
//            }else {
//                String val = scanner.next();
//                string += val;
//            }
//        }
        long len = string.length();
        StringBuffer stringBuffer = new StringBuffer(string);
        while (true){
            int flag = 1;
            for (int i = 0; i < len; i++) {
                if(stringBuffer.charAt(i)==a && i+1<len && stringBuffer.charAt(i+1)==b){
                    stringBuffer.deleteCharAt(i);
                    stringBuffer.deleteCharAt(i);
                    flag = 0;
                    count++;
                    len = stringBuffer.length();
                    break;
                }
            }
            if(flag==1){
                break;
            }
        }
        string = stringBuffer.toString();
        System.out.println(count+" "+string);
    }

}
